package gcdLcm;

public class GcdLcm {
	int i, max, min;

	public void compare(int num1, int num2) {
		max = num1 >= num2 ? num1 : num2;
		min = num1 <= num2 ? num1 : num2;
	}

	public int gcd() {
		for (i = min; max % i != 0 || min % i != 0; i--) {
		}
		return i;
	}

	public int lcm() {
		for (i = max; i % max != 0 || i % min != 0; i++) {
		}
		return i;
	}
}
